BaseGridList=Ext.extend(Ext.Panel,{	
	layout:"fit",	
	pageSize:10,
	closable: true,
  	autoScroll:true,
  	pagingToolbar:true,
  	gridViewConfig:{},
	initComponent : function(){		
	BaseGridList.superclass.initComponent.call(this);	
    this.store=new Ext.data.JsonStore({
		id:"id",
       	url:this.url,
       	root:"result",
  		totalProperty:"rowCount",
  		remoteSort:true,  		
  		fields:this.storeMapping});  		
      	this.store.paramNames.sort="orderBy";
	 	this.store.paramNames.dir="orderType";	  
      	this.cm.defaultSortable=true;  
      	var viewConfig=Ext.apply({forceFit:true},this.gridViewConfig);
	    this.grid=new Ext.grid.GridPanel({
	        store: this.store,
	        height:Ext.get('myCustomerList').getComputedHeight(),
	        cm: this.cm,
	        trackMouseOver:false,    
	        loadMask: true,
	        viewConfig:viewConfig,
	        bbar:this.pagingToolbar?new Ext.PagingToolbar({
	            pageSize: this.pageSize,
	            store: this.store,
	            displayInfo: true,
	            displayMsg: 'Displaying records {0} - {1} of {2}',
	            emptyMsg: "No record to display"
	        }):null
	   		});   		   		 
	this.add(this.grid);
	if(this.loadData)this.store.load();
	}     
});
MyCustomerList=Ext.extend(BaseGridList,{
	id:"myCustomerList",
	loadData:true,
	url:"?cmd=myCustomerList",	
   	storeMapping:["id","im","user",{name:"userName",mapping:"user.name"},"tel","applyTime","paymentTime","sums","confirmTime","expireTime","remark","status","gift","delivery","paymentType","linkMan"], 
    userRender:function(v){
    	return v?v.name:"未知原因";
    },
    emailRender:function(v){
    	return v?v.email:"未知原因";
    },
	initComponent : function(){	
	this.cm=new Ext.grid.ColumnModel([    
    		{header: "申请人", sortable:true,width:100, dataIndex:"user"},
    		{header: "状态", sortable:true,width: 60, dataIndex:"status"},
    		{header: "im", sortable:true,width: 100, dataIndex:"im"},
    		{header: "email", sortable:true,width: 100, dataIndex:"user"},
    		{header: "申请日期", sortable:true,width:100, dataIndex:"applyTime"},
			{header: "支付日期", sortable:true,width: 100, dataIndex:"paymentTime"},
			{header: "金额", sortable:true,width: 50, dataIndex:"sums"},
			{header: "确认日期", sortable:true,width:100, dataIndex:"confirmTime"},
			{header: "备注", sortable:true, dataIndex:"remark"}
        ]);		
	MyCustomerList.superclass.initComponent.call(this);
	}     
});
Ext.onReady(function(){
 	var grid=new MyCustomerList();
 	grid.render('myCustomerList');
});